<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateLogSiteScoreTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('log_site_score', function(Blueprint $table)
		{
			$table->integer('id', true)->comment('主键');
			$table->integer('site_id')->comment('站点id');
			$table->integer('player_id')->nullable()->comment('玩家id');
			$table->integer('main_game_plats_id')->comment('平台id,如主平台为0即为通用分');
			$table->string('transferid')->nullable()->comment('订单号');
			$table->decimal('rate', 5, 4)->nullable()->default(0.0000)->comment('兑换比率');
			$table->decimal('recharge_money', 13, 4)->default(0.0000)->comment('充值金额');
			$table->decimal('recharge_score', 13, 4)->default(0.0000)->comment('加分');
			$table->decimal('original', 15, 5)->default(0.00000)->comment('变动前的分值');
			$table->decimal('change', 15, 5)->default(0.00000)->comment('变动的分值');
			$table->decimal('before_money', 15, 5)->default(0.00000)->comment('前余额');
			$table->decimal('now_money', 15, 5)->default(0.00000)->comment('现余额');
			$table->string('op')->default('')->comment('操作, 0：网站加分，1：管理员加分，2：平台转入，3：平台转出');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('log_site_score');
	}

}
